package tcu.iot.gasmanage.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tcu.iot.gasmanage.entity.baidumap.AllMapData;
import tcu.iot.gasmanage.entity.baidumap.AllPointsInfo;

import java.util.List;

@Mapper
public interface BaiduMapMapper {

    //private String name;
    //    private double lat;
    //    private double lng;
    //    private String equipmentName;
    //    private String equipmentNumber;
    //    private String equipmentType;
    //    private int electricQuantity;
    @Select("SELECT lat,lng FROM equipment")
    List<AllMapData> getAllMapData();

    @Select("SELECT equipmentNumber,equipmentName,equipmentType,management,electricQuantity,lat,lng FROM equipment")
    @Results({@Result(property = "equipmentNumber", column = "equipmentNumber"), @Result(property = "equipmentName", column = "equipmentName"), @Result(property = "equipmentType", column = "equipmentType"), @Result(property = "lat", column = "lat"),
            @Result(property = "lng", column = "lng"), @Result(property = "electricQuantity", column = "electricQuantity"), @Result(property = "name", column = "management")})
    List<AllPointsInfo> getAllPointsInfo();
}
